From e88a23b123a58edde070f6678d1b1bee80574414 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Thu, 27 Dec 2007 12:03:02 +0000 Subject: [PATCH] vmx: Map the VLAPIC access page as mmio-direct in the p2m. This prevents emulated accesses to this page, which would not be handled in the correct way (VMX handles accesses to that page in non-root mode in a very super-special way). Signed-off-by: Keir Fraser --- xen/arch/x86/hvm/vmx/vmx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index ddf60430d3..1e700d8d2e 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -2432,8 +2432,8 @@ static int vmx_alloc_vlapic_mapping(struct domain *d) if ( apic_va == NULL ) return -ENOMEM; share_xen_page_with_guest(virt_to_page(apic_va), d, XENSHARE_writable); - guest_physmap_add_page( - d, paddr_to_pfn(APIC_DEFAULT_PHYS_BASE), virt_to_mfn(apic_va)); + set_mmio_p2m_entry( + d, paddr_to_pfn(APIC_DEFAULT_PHYS_BASE), _mfn(virt_to_mfn(apic_va))); d->arch.hvm_domain.vmx_apic_access_mfn = virt_to_mfn(apic_va); return 0; -- 2.30.2